import type { ProColumns } from '@ant-design/pro-table';
import type { MotifItem, ViewColumnsItem } from './data';

export const motifColumns: ProColumns<MotifItem>[] = [
  {
    title: '序号',
    dataIndex: 'order',
    valueType: 'indexBorder',
    hideInSearch: true,
    width: 50,
    fixed: 'left',
  },
  {
    title: '提案主题',
    dataIndex: 'name',
    ellipsis: true,
    width: 160,
    fixed: 'left',
  },
  {
    title: 'code',
    dataIndex: 'voteCode',
    hideInSearch: true,
    width: 100,
  },
  {
    title: '提案类型',
    dataIndex: 'type',
    width: 100,
    valueType: 'select',
    valueEnum: {
      1: {
        text: '薪酬',
      },
      2: {
        text: '普通',
      },
    },
  },
  {
    title: '状态',
    dataIndex: 'status',
    hideInSearch: true,
    width: 100,
    valueType: 'select',
    valueEnum: {
      1: {
        text: '未发布',
        status: 'Default',
      },
      2: {
        text: '进行中',
        status: 'Processing',
      },
      3: {
        text: '已结束',
        status: 'Success',
      },
    },
  },
  {
    title: '开始时间',
    dataIndex: 'startTime',
    hideInSearch: true,
    width: 160,
  },
  {
    title: '结束时间',
    dataIndex: 'endTime',
    hideInSearch: true,
    width: 160,
  },
  {
    title: '创建时间',
    dataIndex: 'createTime',
    hideInSearch: true,
    width: 160,
  },
  {
    title: '描述',
    dataIndex: 'description',
    hideInSearch: true,
    ellipsis: true,
    width: 200,
  },
];

export const viewColumns: ProColumns<ViewColumnsItem>[] = [
  {
    title: '序号',
    dataIndex: 'order',
    valueType: 'indexBorder',
    hideInSearch: true,
    width: 50,
    fixed: 'left',
  },
  {
    title: '候选项名称',
    dataIndex: 'name',
    ellipsis: true,
    width: 160,
    fixed: 'left',
  },
  {
    title: '候选项编号',
    dataIndex: 'electedPersonNo',
    hideInSearch: true,
    width: 160,
  },
  {
    title: '得票数',
    dataIndex: 'votes',
    hideInSearch: true,
    width: 100,
  },
  {
    title: '创建时间',
    dataIndex: 'createTime',
    hideInSearch: true,
    width: 160,
  },
  {
    title: '描述',
    dataIndex: 'description',
    hideInSearch: true,
    ellipsis: true,
    width: 200,
  },
];
